#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>
int main() {
    int i = 0;
    for (i = 10000; i < 99999; i++)
    {
        int j = 0;
        int tmp = i, a = 0, b = 0, c = 0;
        for (j = 1; j <= 4; j++)
        {
            b = tmp % (int)pow(10,j);
            a = tmp / (int)pow(10, j);
            c = c + b * a;
        }
        if (c == i)
        {
            printf("%d ", i);
        }
    }
    return 0;
}